package com.hongyun.tms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hongyun.tms.common.dto.pordwork.PordWorkSpecialQueryDto;
import com.hongyun.tms.entity.PordWork;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * <p>
 * 拖轮作业记录表 Mapper 接口
 * </p>
 *
 * @author liPeng
 * @since 2024-06-24
 */
public interface PordWorkMapper extends BaseMapper<PordWork> {

    Page<PordWork> selectSpecialWorkPage(Page<PordWork> page,
                                         @Param("query") PordWorkSpecialQueryDto query,
                                         @Param("approvedStatus") Integer approvedStatus,
                                         @Param("feeStatus") Integer feeStatus);

    /**
     * 特殊作业记录计费
     *
     * @param query          查询
     * @param approvedStatus 审核状态
     * @param feeStatus      计费状态
     * @return fee
     */
    BigDecimal sumSpecialWorkAmount(@Param("query") PordWorkSpecialQueryDto query,
                                    @Param("approvedStatus") Integer approvedStatus,
                                    @Param("feeStatus") Integer feeStatus);
}
